﻿declare @myr int
SELECT @myr = HierarchicalRight from Category
WHERE Appellation = 'c2-1';

UPDATE Category SET HierarchicalRight = HierarchicalRight + 2 WHERE HierarchicalRight > @myr;   
UPDATE Category SET HierarchicalLeft = HierarchicalLeft + 2 WHERE HierarchicalLeft > @myr;   

INSERT INTO [Category]
           ([CategoryId]
           ,[Appellation]
           ,[AssetEntryAdditionalDefinition]
           ,[HierarchicalLeft]
           ,[HierarchicalRight])
     VALUES
           (NEWID()
           ,'c2-1-1'
           ,''
           ,@myr+1
           ,@myr+2)
GO

select * from Category